import 'package:flutter/material.dart';
import 'package:wechat/const.dart';
import 'package:wechat/pages/chat/search_page.dart';

import 'chat_page.dart';

class SearchCell extends StatelessWidget {
  List<Chat> datas = [];
  SearchCell(this.datas);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        //Push 页面
        Navigator.of(context).push(MaterialPageRoute(
            builder: (BuildContext context) => SearchPage(datas)));
        print('点击了搜索框!');
      },
      child: Container(
        height: 44,
        color: WeChatThemeColor,
        padding: EdgeInsets.all(5),
        child: Stack(
          alignment: Alignment.center,
          children: [
            Container(
              decoration: BoxDecoration(
                  color: Colors.white, borderRadius: BorderRadius.circular(6)),
            ), //白底
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Image(
                  image: AssetImage('images/放大镜b.png'),
                  width: 15,
                  color: Colors.grey,
                ),
                Text(
                  ' 搜索',
                  style: TextStyle(fontSize: 15, color: Colors.grey),
                )
              ],
            ),
          ],
        ),
      ),
    );
  }
}
